package main

import (
	"net"
	"net/rpc"
	"oldpackagetest/new_helloworld/handler"
	"oldpackagetest/new_helloworld/server_proxy"
)

func main() {
	//1。实例化一个server
	listener, _ := net.Listen("tcp", ":1234")
	//2. 注册处理逻辑handler
	server_proxy.RegisterHelloService(&handler.HelloService{})
	//_ = rpc.RegisterName(handler.HelloServiceName, &handler.HelloService{})

	//3．启动服务
	for {
		conn, _ := listener.Accept()
		go rpc.ServeConn(conn)
	}
}
